<!DOCTYPE html>
<html lang="en">
	<head>
		<include file="Index/head" />
		<style type="text/css">
		.dl_dd dd{ text-align: center; margin-top: 30px;}
		.hidden_div{ border:3px solid #307ecc;}
		.hidden_div2{ border:3px solid #307ecc;}
		</style>
	</head>

	<body>
		<include file="Index/header" />

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<include file="Index/menu" />
				
				<div class="main-content">
					<include file="Index/nav" />

					<div class="page-content">
						
							<!-- /**
							 * 右侧页面begin
							 */ -->
						<div class="row">
							<div class="col-xs-12">
								<div class="table-header">
									标签列表
								</div>

								<div class="table-responsive">
									<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
									<div class="row">
									<div class="col-xs-12">
                                                                            <form action="{:U('Admin/Tag/tag_product_search_result')}" method="get">
                                                                                <input name="search" value="1" type="hidden" />
                                                                                <input name="tagid" value="{$tagid}" type="hidden" />
                                                                                <div class="form-group">
                                                                                    
                                                                                        <label class="col-sm-3" for="form-field-select-1">分类</label>
                                                                                        <div class="col-sm-9">
                                                                                            <select name="sortname" class=" form-control" id="form-field-select-1">
                                                                                                <option value="乳制品">乳制品</option>
                                                                                                <option value="冷冻饮品">冷冻饮品</option>
                                                                                                <option value="水产及水产制品">水产及水产制品</option>
                                                                                                <option value="水产品及水产制品">水产品及水产制品</option>
                                                                                                <option value="水果及其制品">水果及其制品</option>
                                                                                                <option value="炒货食品及坚果制品">炒货食品及坚果制品</option>
                                                                                                <option value="焙烤食品">焙烤食品</option>
                                                                                                <option value="特殊膳食食品">特殊膳食食品</option>
                                                                                                <option value="粮食及粮食制品">粮食及粮食制品</option>
                                                                                                <option value="糖果及可可制品">糖果及可可制品</option>
                                                                                                <option value="罐头">罐头</option>
                                                                                                <option value="肉及肉制品">肉及肉制品</option>
                                                                                                <option value="茶叶及其相关制品、咖啡">茶叶及其相关制品、咖啡</option>
                                                                                                <option value="蔬菜及其制品">蔬菜及其制品</option>
                                                                                                <option value="蔬菜及其制品蔬菜及其制品">蔬菜及其制品蔬菜及其制品</option>
                                                                                                <option value="薯类及膨化食品">薯类及膨化食品</option>
                                                                                                <option value="蛋及蛋制品">蛋及蛋制品</option>
                                                                                                <option value="蜂产品">蜂产品</option>
                                                                                                <option value="调味品">调味品</option>
                                                                                                <option value="豆类">豆类</option>
                                                                                                <option value="豆类及其制品">豆类及其制品</option>
                                                                                                <option value="豆类及其制品及其制品">豆类及其制品及其制品</option>
                                                                                                <option value="酒类">酒类</option>
                                                                                                <option value="食品添加剂">食品添加剂</option>
                                                                                                <option value="食用油、油脂及其制品">食用油、油脂及其制品</option>
                                                                                                <option value="食糖">食糖</option>
                                                                                                <option value="饮料">饮料</option>
                                                                                                
                                                                                        </select>
                                                                                        </div>
                                                                                        
                                                                                
                                                                                </div>
                                                                                <br/><br/>
                                                                                <div class="form-group">
                                                                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 关键字 </label>

                                                                                        <div class="col-sm-9">
                                                                                                <input name="keyword" type="text" id="form-field-1" placeholder="产品关键字" class="col-xs-10 col-sm-5">
                                                                                        </div>
                                                                                </div>
                                                                                <br/><br/>
                                                                                <div class="form-group">
                                                                                    
                                                                                        <label class="col-sm-3" for="form-field-select-1">分类</label>
                                                                                        <div class="col-sm-9">
                                                                                            <button class="btn btn-info" type="submit">
												<i class="icon-ok bigger-110"></i>
												提交
											</button>
                                                                                        </div>
                                                                                        
                                                                                
                                                                                </div>
                                                                                
                                                                                
                                                                            </form>
                                                                        </div>
									</div>
									
									
								</div>
							</div>

							


							<div class="hidden_div2" hidden="hidden" style=" width:500px; height:250px; background-color:#fff; position:fixed; left:40%; top:40%;">
								<!-- PAGE CONTENT BEGINS -->
								<form action="{:U('Admin/Tag/modify')}" method="POST" enctype="multipart/form-data">
									<input type="text" id="tag_id" name="id" hidden="hidden" />
									<dl class="dl_dd">
										<dd>
											<label>标签名:</label>
											<input type="text" id="tag_name" name="tag_name" />
										</dd>
										<dd style=" margin-left:181px; margin-top:30px;">
											<input type="file" name="thumb" />
										</dd>
										<dd style="margin-left:10px;">
											<label>排序:</label>
											<input type="text" id="tag_rank" placeholder="数字越大越靠前" name="rank" />
										</dd>
										<dd>
											<button type="submit">修改</button>
											<button type="button" id="unset2">取消</button>
										</dd>
									</dl>
								</form>
							</div>
						</div>
						
							<!-- /**
							 * 右侧页面end
							 */ -->
					</div><!-- /.page-content -->
				</div>

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<include file="Index/footer" />
		<script type="text/javascript">
		$(document).ready(function(){
			$(".btn-white").bind('click',function(){
				$(".hidden_div").show();
			});

			$("#unset").bind('click',function(){
				$(".hidden_div").hide();
			});

			$(".red").bind('click',function(){
				var rs = confirm('确定删除该标签?');
				if(rs){

					var url = "{:U('Admin/Tag/del')}";
					var id = $(this).attr('bid');
					$.ajax({
						type:'post',
						url:url,
						data:{id:id},
						dataType:'json',
						success:function(data){
							if(data==1){

								window.location.href="{:U('Admin/Tag/lists')}";
							}else{

								alert('删除失败!');
							}
						}
					});
				}else{

					return false;
				}
			});


			$(".green").bind('click',function(){
				$(".hidden_div2").show();

				var id = $(this).attr('bid');
				$("#tag_id").val(id);
				var tag_name = $(this).attr('tagname');
				// alert(tag_name);
				$("#tag_name").val(tag_name);
				var rank = $(this).attr('rank');
				// alert(rank);
				$("#tag_rank").val(rank);
			});

			$("#unset2").bind('click',function(){
				$(".hidden_div2").hide();
			});
		});
		</script>
	</body>
</html>
